<template>
  <div>
      <van-nav-bar
        title="收货地址"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
    />
    <van-address-edit
        :area-list="areaList"
        show-postal
        show-delete
        show-set-default
        show-search-result
        :search-result="searchResult"
        :area-columns-placeholder="['请选择', '请选择', '请选择']"
        @save="onSave"
        @delete="onDelete"
    />
  </div>
</template>

<script>
import Vue from 'vue';
import { areaList } from '@vant/area-data';
import { AddressEdit , Toast, Area,NavBar} from 'vant';

Vue.use(AddressEdit)
Vue.use(Toast)
Vue.use(Area)
Vue.use(NavBar)
export default {
    name:"AddressEdit",
      data() {
        return {
        areaList,
        searchResult: [],
        };
    },
    methods: {
        onSave() {
            Toast('保存成功');
            this.$router.push("/Address")
        },
        onDelete() {
            Toast('删除成功');
            this.$router.push("/Address")
        },
        onClickLeft() {
        Toast('返回');
        this.$router.push("/Address")
        },  
    },
    mounted() {
        this.$bus.$emit('changeFlag',4)
    },
}
</script>

<style>

</style>